find_program(SCCACHE_FOUND sccache)
if (SCCACHE_FOUND)
   message(STATUS "Using sccache")
   set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE sccache)
else()
   find_program(CCACHE_FOUND ccache)
   if (CCACHE_FOUND)
      message(STATUS "Using ccache")
      set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
   endif()
endif()

add_test( asset_tests ${CMAKE_BINARY_DIR}/tests/unit/asset_tests )
set_property(TEST asset_tests PROPERTY LABELS unit_tests)
add_test( binary_extension_tests ${CMAKE_BINARY_DIR}/tests/unit/binary_extension_tests )
set_property(TEST binary_extension_tests PROPERTY LABELS unit_tests)
add_test( crypto_tests ${CMAKE_BINARY_DIR}/tests/unit/crypto_tests )
set_property(TEST crypto_tests PROPERTY LABELS unit_tests)
add_test( datastream_tests ${CMAKE_BINARY_DIR}/tests/unit/datastream_tests )
set_property(TEST datastream_tests PROPERTY LABELS unit_tests)
add_test( fixed_bytes_tests ${CMAKE_BINARY_DIR}/tests/unit/fixed_bytes_tests )
set_property(TEST fixed_bytes_tests PROPERTY LABELS unit_tests)
add_test( name_tests ${CMAKE_BINARY_DIR}/tests/unit/name_tests )
set_property(TEST name_tests PROPERTY LABELS unit_tests)
add_test( rope_tests ${CMAKE_BINARY_DIR}/tests/unit/rope_tests )
set_property(TEST rope_tests PROPERTY LABELS unit_tests)
add_test( print_tests ${CMAKE_BINARY_DIR}/tests/unit/print_tests )
set_property(TEST print_tests PROPERTY LABELS unit_tests)
add_test( serialize_tests ${CMAKE_BINARY_DIR}/tests/unit/serialize_tests )
set_property(TEST serialize_tests PROPERTY LABELS unit_tests)
add_test( string_tests ${CMAKE_BINARY_DIR}/tests/unit/string_tests )
set_property(TEST string_tests PROPERTY LABELS unit_tests)
add_test( symbol_tests ${CMAKE_BINARY_DIR}/tests/unit/symbol_tests )
set_property(TEST symbol_tests PROPERTY LABELS unit_tests)
add_test( system_tests ${CMAKE_BINARY_DIR}/tests/unit/system_tests )
set_property(TEST system_tests PROPERTY LABELS unit_tests)
add_test( time_tests ${CMAKE_BINARY_DIR}/tests/unit/time_tests )
set_property(TEST time_tests PROPERTY LABELS unit_tests)
add_test( varint_tests ${CMAKE_BINARY_DIR}/tests/unit/varint_tests )
set_property(TEST varint_tests PROPERTY LABELS unit_tests)

if (eosio_FOUND AND EOSIO_RUN_INTEGRATION_TESTS)
   add_test(integration_tests ${CMAKE_BINARY_DIR}/tests/integration/integration_tests)
   set_property(TEST integration_tests PROPERTY LABELS integration_tests)
endif()
